/**
 * 
 * 广州锐鹏计算机科技有限公司（www.ruipengkj.com）
 * 
 * 
 * Copyright (c) 2011-2012 RUIPENGKJ.Co.Ltd. All rights reserved.
 * 
 * */
package com.ruipengkj.bean;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 说明：
 * Entity Name 仓库
 * @Author：李智深
 * @Date：2012-03-14
 */
@Entity
@Table(name="ruipeng_tb_TStore")
public class TStore implements Serializable{

	private static final long serialVersionUID = 1L;

	private String StoreID;//仓库编号 CHAR(15) PK

	private String Name;//仓库名称VARCHAR(128)

	private String Location;//仓库地址VARCHAR(100)

	private Date CreateTime=new Date();//仓库成立时间

	private String Manager;//仓库管理员CHAR(15)

	private String Note; //备注VARCHAR100
	
	private int Priority;//仓库优先级INTEGER   用于排序和设置默认。 数值越大则越在前，默认出入库操作时为优先级最高的库
	
	private Set<TStock> TStocks=new HashSet<TStock>(0);//商品库存
	
	private Set<TStockInOut> TStockInOuts=new HashSet<TStockInOut>(0);//入/出库单

	public TStore(){};
	
	public TStore(String StoreID) {
		this.StoreID = StoreID;
	}
	@Id
	@Column(name = "StoreID", length=15)
	public String getStoreID() {
		return StoreID;
	}
	
	public void setStoreID(String storeID) {
		StoreID = storeID;
	}

	@Column(name = "Name", length=128)
	public String getName() {
		return Name;
	}

	public void setName(String name) {
		Name = name;
	}

	@Column(name = "Location", length=100)
	public String getLocation() {
		return Location;
	}

	public void setLocation(String location) {
		Location = location;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CreateTime", nullable = false, length = 19)
	public Date getCreateTime() {
		return CreateTime;
	}

	public void setCreateTime(Date createTime) {
		CreateTime = createTime;
	}
	
	@Column(name = "Note", length=100)
	public String getNote() {
		return Note;
	}
	
	public void setNote(String note) {
		Note = note;
	}
	
	@Column(name = "Manager", length=15)
	public String getManager() {
		return Manager;
	}

	public void setManager(String manager) {
		Manager = manager;
	}

	@Column(name = "Priority")
	public int getPriority() {
		return Priority;
	}

	public void setPriority(int priority) {
		Priority = priority;
	}


	@OneToMany(mappedBy="TStore")
	@JoinColumn(name="StoreID")
	public Set<TStock> getTStocks() {
		return TStocks;
	}

	public void setTStocks(Set<TStock> tStocks) {
		TStocks = tStocks;
	}
	@OneToMany(mappedBy="TStore")
	@JoinColumn(name="StoreID")
	public Set<TStockInOut> getTStockInOuts() {
		return TStockInOuts;
	}

	public void setTStockInOuts(Set<TStockInOut> tStockInOuts) {
		TStockInOuts = tStockInOuts;
	}
}
